{"ast":null,"code":"import { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { FormContext } from '../context';\nexport default function useItemRef() {\n  var _React$useContext = React.useContext(FormContext),\n    itemRef = _React$useContext.itemRef;\n  var cacheRef = React.useRef({});\n  function getRef(name, children) {\n    var childrenRef = children && typeof children === 'object' && children.ref;\n    var nameStr = name.join('_');\n    if (cacheRef.current.name !== nameStr || cacheRef.current.originRef !== childrenRef) {\n      cacheRef.current.name = nameStr;\n      cacheRef.current.originRef = childrenRef;\n      cacheRef.current.ref = composeRef(itemRef(name), childrenRef);\n    }\n    return cacheRef.current.ref;\n  }\n  return getRef;\n}","map":{"version":3,"names":["composeRef","React","FormContext","useItemRef","useContext","itemRef","cacheRef","useRef","getRef","name","children","childrenRef","ref","nameStr","join","current","originRef"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/form/hooks/useItemRef.js"],"sourcesContent":["import { composeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { FormContext } from '../context';\nexport default function useItemRef() {\n  const {\n    itemRef\n  } = React.useContext(FormContext);\n  const cacheRef = React.useRef({});\n  function getRef(name, children) {\n    const childrenRef = children && typeof children === 'object' && children.ref;\n    const nameStr = name.join('_');\n    if (cacheRef.current.name !== nameStr || cacheRef.current.originRef !== childrenRef) {\n      cacheRef.current.name = nameStr;\n      cacheRef.current.originRef = childrenRef;\n      cacheRef.current.ref = composeRef(itemRef(name), childrenRef);\n    }\n    return cacheRef.current.ref;\n  }\n  return getRef;\n}"],"mappings":"AAAA,SAASA,UAAU,QAAQ,gBAAgB;AAC3C,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,WAAW,QAAQ,YAAY;AACxC,eAAe,SAASC,UAAU,GAAG;EACnC,wBAEIF,KAAK,CAACG,UAAU,CAACF,WAAW,CAAC;IAD/BG,OAAO,qBAAPA,OAAO;EAET,IAAMC,QAAQ,GAAGL,KAAK,CAACM,MAAM,CAAC,CAAC,CAAC,CAAC;EACjC,SAASC,MAAM,CAACC,IAAI,EAAEC,QAAQ,EAAE;IAC9B,IAAMC,WAAW,GAAGD,QAAQ,IAAI,OAAOA,QAAQ,KAAK,QAAQ,IAAIA,QAAQ,CAACE,GAAG;IAC5E,IAAMC,OAAO,GAAGJ,IAAI,CAACK,IAAI,CAAC,GAAG,CAAC;IAC9B,IAAIR,QAAQ,CAACS,OAAO,CAACN,IAAI,KAAKI,OAAO,IAAIP,QAAQ,CAACS,OAAO,CAACC,SAAS,KAAKL,WAAW,EAAE;MACnFL,QAAQ,CAACS,OAAO,CAACN,IAAI,GAAGI,OAAO;MAC/BP,QAAQ,CAACS,OAAO,CAACC,SAAS,GAAGL,WAAW;MACxCL,QAAQ,CAACS,OAAO,CAACH,GAAG,GAAGZ,UAAU,CAACK,OAAO,CAACI,IAAI,CAAC,EAAEE,WAAW,CAAC;IAC/D;IACA,OAAOL,QAAQ,CAACS,OAAO,CAACH,GAAG;EAC7B;EACA,OAAOJ,MAAM;AACf"},"metadata":{},"sourceType":"module"}